(function($){
	$here = 0;
	$speed = 4000;
	$timeout = 0;
	function hover(){
		if($here == $eles.length-1){
			$here = 0;
			
		}else{
			$here++;
		}
		
		if($here != 0){
			$($eles[$here-1]).removeClass('hover');
		}else{
			$($eles[$eles.length-1]).removeClass('hover');
		}
		$($eles[$here]).addClass('hover');
		
		$timeout = setTimeout(hover,5500);
	}
	$(document).ready(function() {
		$eles = $('.box');
		if($here == 0){
			$($eles[$here]).addClass('hover');
		}
		$timeout = setTimeout(hover,$speed);
		$eles.bind({
				mouseover: function(){
					$($eles[$here]).removeClass('hover');
					$(this).addClass('hover');
					clearTimeout($timeout);
				},
				mouseout: function(){
					$(this).removeClass('hover');
					$($eles[$here]).addClass('hover');
					$timeout = setTimeout(hover,$speed);
				}
			});
	});
})(jQuery);